Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Replace the different network response types with ApiResult #1261

Merged
merged 8 commits into from
Feb 5, 2025

Conversation

nikclayton
Copy link
Contributor

@nikclayton nikclayton commented Feb 5, 2025

Previous code used five (!) different types for the network response.

Some used Retrofit's Response. This provides access to the headers.

Some used NetworkResult. This did not provide access to the headers,
but did provide some higher-order functions (e.g., fold) for operating
on the results.

One used a raw Map.

One used a raw Call.

The rest had been converted to ApiResult, a Result<V, ApiError>.
This provides the higher-order functions, provides the headers, and
is exception-free, so is the correct type to use.

This PR completes the work of cutting over to ApiResult. The return
values are changed and the calling code is adjusted to use the new
functions as appropriate.

@nikclayton nikclayton merged commit 91d577c into pachli:main Feb 5, 2025
27 checks passed
@nikclayton nikclayton deleted the apiresult-everywhere branch February 5, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant